package com.naiterui.ehp.bs.recommend.remote;


import java.util.List;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.scheduling.annotation.Async;
import org.springframework.web.bind.annotation.*;

import com.naiterui.ehp.bp.bo.patient.*;
import com.naiterui.ehp.bp.support.config.FeignConfiguration;
import com.naiterui.ehp.bp.support.exception.BusinessException;

/**
 * @author gaoliangliang
 * @date 2019-06-24 14:57
 * @since 1.0.0
 */
@FeignClient(name = "recommendAp", url = "${ehp.domain.ap}", configuration = FeignConfiguration.class)
public interface IPatientFeignClient {

    int PATIENT_PUSH_PLATFORMID = 2;
    int PATIENT_PUSH_TEMPLATED_DRUGREMIND = 1;
    int PATIENT_PUSH_TEMPLATED_REVISIT = 2;
    int PATIENT_PUSH_TEMPLATED_ALAEMCLOCK = 3;
    int PATIENT_PUSH_TEMPLATED_ALAEMCLOCK_CONFIG = 4;


    @Async
    @RequestMapping("inner/push")
    Boolean patientPush(@RequestParam("platformId") Integer platformId,
                        @RequestParam("templateId") Integer templateId,
                        @RequestParam("paramData") String paramDate) throws BusinessException;


    @RequestMapping("inner/personal/doctor/revisit")
    RevisitDoctorBO revisitDoctorBO(@RequestParam("patientId") Long patientId,
                                    @RequestParam("doctorId") Long doctorId) throws BusinessException;

    @RequestMapping("inner/patient/require/notice")
    void sendNotice(@RequestBody RequireReplyTemplateMsgBO msgBO) throws BusinessException;

    /**
     * 向患者推送处方消息
     * @param publishParamBO
     * @throws BusinessException
     */
    @RequestMapping("inner/message/publish")
    void sendRecommend(@RequestBody MsgPublishParamBO publishParamBO) throws BusinessException;

    /**
     * 获取就诊人信息
     * @param inquirerIds
     * @return
     * @throws BusinessException
     */
    @PostMapping("inner/patient/inquirer/list")
    List<PatientInquirerBO> getPatientInquirer(@RequestBody List<Long> inquirerIds) throws BusinessException;

    /**
     * 获取患者详情
     * @param patientId
     * @return
     * @throws BusinessException
     */
    @PostMapping("inner/patient/base")
    PatientBO getBaseInfo(@RequestParam("patientId") Long patientId) throws BusinessException;

    /**
     * 根据id获取基础信息
     * @param patientId
     * @return
     * @throws BusinessException
     */
    @GetMapping("inner/patient/getBaseInfoById")
    PatientBaseBO getBaseInfoById(@RequestParam("patientId") Long patientId) throws BusinessException;

    /**
     * 小程序消息
     * @param publishParamBO
     * @return
     */
    @PostMapping("/inner/message/ma/publish")
    MsgPublishBO publishMaMessage(@RequestBody MsgMaPublishParamBO publishParamBO);
}
